package com.gzu.emr.util;

import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author chuchu
 * @version 1.0
 * @date 2023-07-20
 **/
@Slf4j
public class HttpUtil {



    /**
     * 判断当前请求是否是ajax请求
     *
     * @param request 请求对象
     * @return boolean
     */
    public static boolean isAjaxRequest(HttpServletRequest request) {
        return "XMLHttpRequest".equals(request.getHeader("X-Requested-With"));
    }
}